package org.jtb.quickr;

import java.io.InputStream;
import org.jdom.Element;

/**
 * Photo ID response.
 *
 * @see org.jtb.quickr.UploadService#upload(AuthResponse.Token,UploadCriteria)
 * @see org.jtb.quickr.PhotosService#delete(AuthResponse.Token,PhotoIdResponse)
 */
public class PhotoIdResponse extends FlickrResponse {
    private String idString;
    
    PhotoIdResponse(InputStream is) throws QuickrException{
        super(is);
    }

    public PhotoIdResponse(String idString) throws QuickrException{
        this.idString = idString;
    }
    
    protected void populate(Element e) {
        Element idElement = e.getChild("photoid");
        if (idElement != null) {
            idString = idElement.getText();
        }
    }

    /**
     * Get the string representation of this object.
     * @return This object, as a string.
     */
    public String toString() {
        return idString;
    }
}
